<?php 
class banner extends CI_model{

	function list_banner(){
		$this->db->select('*');
		$this->db->from('banner');
		$this->db->join('banner_language', 'banner.id_banner = banner_language.id_banner');
		$this->db->join('kategori_sub_language', 'banner.id_kategori_sub = kategori_sub_language.id_kategori_sub');
		$this->db->where(array('banner_language.id_language' => '1'));
		$this->db->order_by('banner.id_banner', 'DESC');
		$q = $this->db->get();
		return $q->result();
	}

	function list_banner_2($id_language){
		$query = "SELECT ksl.id_kategori_sub, ksl.nama_kategori_sub FROM setting s JOIN kategori_sub ks 
		ON s.id_table = ks.id_kategori JOIN kategori_sub_language ksl ON ks.id_kategori_sub 
		= ksl.id_kategori_sub";
		/*WHERE s.key =  'kategori_page' AND ksl.id_language =$id_language*/
		$sql = $this->db->query($query);
		return $sql->result();
	}
}

?>